#!/usr/bin/python

import sys

n = int(sys.argv[1])

import random
count = 1

def build_tree(leaves):
    global count
    if leaves == 1:
        print "'"+str(count)+"'",
        count += 1
    else:
        left = random.randint(1,leaves-1)
        right = leaves-left
        print '(',
        build_tree(left)
        build_tree(right)
        print ')',

n1 = random.randint(1,n-2)
n2 = random.randint(1,n-n1-1)
n3 = n-n2-n1

print '(',
build_tree(n1)
build_tree(n2)
build_tree(n3)
print ')'
